package com.xdap.pg.exam.dao;

import com.xdap.pg.exam.config.ExamDatasource;
import com.xdap.pg.exam.entity.ItemBank;
import com.xdap.runtime.service.RuntimeDatasourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @BelongsProject：IntelliJ IDEA
 * @BelongsPackage：com.xdap.pg.exam.dao
 * @Author：fei
 * @CreateTime：2024-12-30 11:07
 * @Description: TODO(要做什么呢 ?)
 * @Version：1.0
 */
@Component
public class ExamDao {

    @Autowired
    RuntimeDatasourceService runtimeDatasourceService;

    @Autowired
    ExamDatasource examDatasource;

    public List<Map<String,Object>> queryItemBank(List<String> codes){
        return runtimeDatasourceService.buildTenantMpaasQuery(examDatasource.getDataSource())
                .in("Code",codes)
                .like("item_isfinished","yes")
                .table("item_bank")
                .doQuery();
    }
}
